/**
 * qujiakang
 * ProcessManager.java 创建于 2007-7-30
 */
package org.jackysoft.controller;

import java.util.Collection;

import javax.annotation.Resource;

import org.jackysoft.controller.base.AbstractController;
import org.jackysoft.entity.OsVariableContext;
import org.jackysoft.entity.WorkflowNode;
import org.jackysoft.service.OsVariableContextService;
import org.jackysoft.service.WorkflowNodeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author qujiakang
 * 
 */

@Controller
@RequestMapping("/oswf/definition")
public class ProcessController extends AbstractController<WorkflowNode> {
	@Resource
	private WorkflowNodeService service;
	
	@Resource
	private OsVariableContextService vsService;
	@RequestMapping("/findbyname")
	public void getbyname(
			String refname,
			@ModelAttribute Collection<OsVariableContext> varSettings,
			@ModelAttribute WorkflowNode bean
			) throws Exception {
		varSettings = vsService.findAllByRefname(refname);
		bean = service.find(refname);
	
	}

	
	@RequestMapping("/show/xmls")
	public void show(String refname,@ModelAttribute String xmlDefine) throws Exception {
		xmlDefine = service.getXml(refname);		
		
	}	

}
